|
SET EFFECT ON
This command will load and apply an FX file to an object.
SET EFFECT ON Object Number, Effect Filename, Texture Flag
Object Number
Integer
The object number
Effect Filename
String
The effect number
Texture Flag
Integer
The texture flag
This command does not return a value.
If the object does not exist onto which an effect is set, a default model is created either specified by the FX file or if none is specified, an internal pyramid model. The FX filename must point to an FX file that is compatible with the DX9 effect framework and typically uses the extension ".fx". If the Texture Flag is set to zero, the effect will use the textures already mapped to the model, and a value of one will discard the current textures and load the textures specified in the FX file. Typically, effects rely on the specified model and textures in the FX file to function properly. Be aware that if you want the X file specified in the effect to load automatically, that X file must be completely compatible with the latest DirectX 9.0c loader, otherwise the model will not be used. The DirectX mesh loader differs from the DBPro object loader, in that the DBP loader can parse and handle more variants of X file.
backdrop off : cls : sync on : sync rate 0 : hide mouse:cls 0
cd "fx\bubble"
load effect "bubble.fx",1,1
load object "sphere.x",1
if effect exist(1)=1 then set object effect 1,1
position object 1,0,0,0
while mouseclick()=0:sync:endwhile
while mouseclick()=1:endwhile
delete object 1
delete effect 1
end
BASIC3D Commands Menu
Index
|